﻿using System;

namespace SapaFinance.Domain.Model
{
    public class User : AbstractEntity
    {
        protected User() {}

        public User(string login, string fullName) : this()
        {
            FullName = fullName;
            Login = login;
        }

        public virtual string FullName { get; set; }
        public virtual string Login { get; set; }

        public override bool Equals(object obj)
        {
            var compare = (User) obj;
            if (ReferenceEquals(null, compare)) return false;
            if (UID != Guid.Empty) return base.Equals(compare);
            return Login.Equals(compare.Login);
        }
    }
}